package framework
{
	import flash.display.DisplayObject;
	
	import mx.core.IFlexDisplayObject;
	import mx.core.IFlexModuleFactory;
	import mx.core.UIComponent;
	import mx.managers.PopUpManager;
	
	import utils.ContainerUtil;
	
	public class PopUpWin extends PopUpManager
	{
		/**
		 * 
		 */
		public static function addPopUpWin(window:IFlexDisplayObject, parent:DisplayObject, 
										   modal:Boolean=true, childList:String=null, moduleFactory:IFlexModuleFactory=null):void
		{
			addPopUp(window, parent, modal, childList, moduleFactory);
			centerPopUp(window);
		}
		
		/**
		 * 
		 */
		public static function createPopUpWin(parent:DisplayObject, className:Class, 
											  modal:Boolean=false, childList:String=null, moduleFactory:IFlexModuleFactory=null):IFlexDisplayObject
		{
			return createPopUp(parent, className, modal, childList, moduleFactory);
		}
		
		/**
		 * 
		 */
		public static function removePopUpWin(popUp:IFlexDisplayObject):void
		{
			removePopUp(popUp);
			ContainerUtil.diposeAll(popUp as UIComponent);
		}
	}
}